<@page.html title="私教余课一览表">
<script type="text/javascript" src="${_appPath!}/js/cal.js"></script>
<script type="text/javascript">
  function gets(c) {
    if(c=="") {
      getEl("sp_salesName").innerHTML = "";
    } else {
      getJson("getSales?code="+encodeURIComponent(c), function(data){
        if(data.ret) {
          getEl("salesCode").value = data.data.code;
          getEl("sp_salesName").innerHTML = data.data.name;
        } else {
          window.alert(data.msg);
          getEl("sp_salesName").innerHTML = "";
        }
      });
    }
  }
  function getc(c) {
    if(c=="") {
      getEl("sp_coachName").innerHTML = "";
    } else {
      getJson("getCoach?code="+encodeURIComponent(c), function(data){
        if(data.ret) {
          getEl("coachCode").value = data.data.code;
          getEl("sp_coachName").innerHTML = data.data.name;
        } else {
          window.alert(data.msg);
          getEl("sp_coachName").innerHTML = "";
        }
      });
    }
  }
</script>
  <div class="search">
    <form id="fm_query" action="_list">
      <dl>
        <dt>门店</dt>
        <dd><script>shopsel('shopCode');</script></dd>
        <!--dt>类型</dt>
        <dd><select name="saleType"><option value="">全部</option><#if saleType??><#list saleType as t><option value="${t.id}">${t.name}</option></#list></#if></select></dd-->
        <dt>分类</dt>
        <dd><select name="itemType"><option value="">全部</option><#if itemType??><#list itemType as t><option value="${t.id}">${t.name}</option></#list></#if></select></dd>
        <dt>合同号</dt>
        <dd><input type="text" name="contractCode" value="" size="14" /></dd>
        <dt>会员卡号</dt>
        <dd><input type="text" name="cardCode" value="" size="16" /></dd>
      </dl>
      <dl>
        <dt>教练工号</dt>
        <dd><input type="text" name="coachCode" id="coachCode" value="" onchange="getc(this.value);" size="8" /> <span id="sp_coachName"></span></dd>
        <dt>销售员工号</dt>
        <dd><input type="text" name="salesCode" id="salesCode" value="" onchange="gets(this.value);" size="8" /> <span id="sp_salesName"></span></dd>
        <dd class="button"><input type="button" value="查询" onclick="query();"></dd>
        <#if canExpt??><dd class="button"><input type="button" value="导出" onclick="expt();"></dd></#if>
      </dl>
    </form>
  </div>
  <div id="div_list"></div>
<script type="text/javascript">query();</script>
</@page.html>